#include <stdio.h>
//编写一个程序,以每行一个单词的形式打印其输入
#define IN 1        //在单词内
#define OUT 0       //在单词外

int main()
{
    int c, state; 

    state = OUT;
    while ((c = getchar()) != EOF)
    {
        if (c == ' ' || c == '\n' || c == '\t') 
        {
            if (state == IN)
            {
                printf("\n");
                state = OUT;
            }   
        }
        else if (state == OUT)
        {
            state = IN;
            putchar(c);
        }
        else
            putchar(c);
   
    }

    return 0;
}